package com.bootdo.repertory.controller;

import com.bootdo.repertory.domain.tubiao.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/repertory/porder")
public class Demo1Controller {


    @GetMapping("/demo2")
    public String demo2(){
        return "repertory/porder/wwy_echarts";
    }



    @ResponseBody
    @GetMapping("/demo1")
    public Object demo1(){
        Demo1Do demo1Do=new Demo1Do();
        Title title=new Title();
        title.setText("示例");
        Legend legend=new Legend();
        legend.setData("销售");
        XAxis xAxis=new XAxis();
        String[] a={"大衣","伞","裤子","袜子","皮鞋","秋裤"};
        xAxis.setData(a);
        Series series=new Series();
        series.setName("销量");
        series.setType("bar");
        Integer[] b={5,26,10,10,20,40};
        series.setData(b);
        demo1Do.setTitle(title);
        demo1Do.setLegend(legend);
        demo1Do.setxAxis(xAxis);
        demo1Do.setSeries(series);
        return demo1Do;
    }
}
